package chtp01;

import java.util.Scanner;
import java.util.Arrays;

public class Main1 {
	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		int sum =0;
		int temp;
		while(true){
			int sc = s.nextInt();
			if(sc>=10000 && sc <=20000){
				System.out.print(Integer.toBinaryString(sc)+",");
				System.out.print(Integer.toOctalString(sc)+",");
				System.out.print(Integer.toHexString(sc));
				System.out.print("\n");
			}
			
			else {
				if(sc<0)
					sc=-sc;
				int a[] = new int[10];
				int i=0;
				while(sc/10!=0){
					temp = sc %10;
					a[i]= temp;
					sc = sc /10;
					sum += temp;
					i++;
				}
				
				temp = sc %10;
				System.out.print(temp+" ");
				sum += temp;
				i--;
				for(;i>=0;i--){
					System.out.print(a[i]+" ");
				}
				
				System.out.print(sum+"\n");
				
			}
			
			sum = 0;	
		}
		
		
		
	}
}